"""
@作者 = "陈诗"
@email = 3168157154@qq.com
@creative_time = 2025/10/31 22:31
"""
import random
import pandas as pd
#  生成编号
# list1 = []
# for i in range(1, 21):
#     a = str(i).zfill(4)
#     list1.append('GK' + a)
# print(sorted(list1))
#
# str0 = input("请输入编号开头字符串:")
# int0 = int(input("请输入编号位数:"))
# int1 = int(input("请输入编号个数:"))
# list2 = []
# for x in range(1, int1 + 1):
#     b = f"{x:0>{int0}}"  # 用0填充,以int0为文本,文本向右对齐,这个特别重要!!!!!!!!!!!(我觉得
#     print(str0 + b)  # 字符串的拼贴
#
# # 提取序号
# list0 = ["KS00001", "KS00015", "KS00234", "KS00765", "KS00984"]
# list1 = []
# for i in list0:  # i是list0的某一个元素
#     a = i[2:]  # 对i切片
#     list1.append(a)
# print(list1)
#
# # 如下文所述
# a = input("请输入一段文字,以此来判断是否是回文:")
# b = a[::-1]
# if a == b:
#     print("是")
# else:
#     print("否")
#
# # 幸运数字
# list0 = []
# list1 = list('abcdefghijklmnopqrstuvwxyz')  # 字母表
# name = list(input("请输入你的名字(拼音或英文):"))  # 导入名字每个字母作为元素
# for i in range(len(name)):  # 注意是长度
#     if str.lower(name[i]).strip() in list1:  # 判断是否为字母并去除空格
#         x = ord(name[i]) - ord('a') + 1  # 字母转数字,统一减去最小数ord('a'),使a = 1,b = 2...
#         list0.append(x)
#         continue  # 返回判断,进入下个循环
#     else:
#         print("请重新输入正确的名字(拼音或英文)!!!!!!!")
#
# print(sum(list0))
#
# # while循环与随机
# n = 0
# list0 = []
# while n < 10:
#     list0.append(random.randint(0, 100))
#     n = n + 1
# print(list0)
#
# xing = ['张', '李', '王']
# ming = ['伟', '娜', '磊']
# list1 = []
# n = 0
# while n < 10:
#     n += 1
#     list1.append(random.choice(xing) + random.choice(ming))
# print(list1)
#
# # while剪刀石头布!
# list0 = ['石头', '剪刀', '布']
# while 1:
#     b = input('石头剪刀布,请输入你的选择: ')
#     a = random.choice(list0)
#     print(f'电脑选择了:{a}')
#     if a == b:
#         print('平局')
#     elif (a == '石头' and b == '剪刀') or (a == '剪刀' and b == '布') or (a == '布' and b == '石头'):
#         print('你输了')
#     elif (a == '石头' and b == '布') or (a == '剪刀' and b == '石头') or (a == '布' and b == '剪刀'):
#         print('你赢了')
#     elif b == '再见':
#         break
#     else:
#         print('输入错误,请重新输入!')
#
#     # for in range猜大小(七次以内
#     import random
#
#     i = random.randint(1, 100)
#     n = 0
#     for n in range(0, 7):
#         n += 1
#         a = int(input("请输入一个整数："))
#         if a == i:
#             print(f'恭喜猜中！一共猜了{n}次')
#             break
#         elif a > i:
#             print("猜大了")
#         else:
#             print("猜小了")

# 随机生成姓名成绩并组合成列表
# list_name1 = ['赵', '钱', '孙', '李', '周', '吴', '郑',
#               '王', '冯', '陈', '褚', '卫', '东方', '沈',
#               '韩', '杨', '欧阳', '秦', '尤', '许', '姚',
#               '邵', '堪', '黄埔', '祁', '毛', '禹', '狄',
#               '米', '贝', '明', '臧', '计', '伏', '成', '戴',
#               '谈', '宋', '茅', '庞', '熊', '纪', '舒', '屈',
#               '项', '祝', '董', '梁']
# # 48个姓
# list_name2 = ['明', '红', '强', '芳', '建', '恺', '凯', '超',
#               '梓涵', '玉', '宝强', '钗', '丽', '云', '来', '圆',
#               '媛媛', '一', '天', '东胜', '栋', '致', '茜', '倩',
#               '志摩', '国庆', '年', '泽', '熙', '那', '和', '远',
#               '允', '妙', '家', '伟', '贤', '然', '笑', '冉', '乾',
#               '坤', '琼', '潇', '雯', '瑶', '翊', '墨', '华']
# # 49个名
# list_score = []
# list_name = []
# for i in range(1, 101):
#     score = random.randint(0, 100)  # 随机成绩[0, 100]整数
#     list_score.append(f'成绩 {score}')  # 随机分数列表,100位
#     list_name.append('姓名: ' + random.choice(list_name1) + random.choice(list_name2))  # 名字列表
#
# list_stu = [list_name[i] + '  ' + str(list_score[i]) for i in range(100)]  # 每名学生姓名成绩对应,且对齐
# df = pd.DataFrame(list_stu)
# print(df)
# 保存并输出  csv格式
# df.to_csv('C:/Users/Lenovo/Desktop/作业/计算机/考生数据.csv', index=False, encoding='utf-8')
# read_ = pd.read_csv('考生数据.csv')
# print(read_)

# 迭代器
list0 = [0, 1, 2, 3]
it = iter(list0)
# while 1:
#     try:
#         print(next(it), end='----')
#     finally:
#         continue
print(next(it))
